package br.com.jgmweb.controller;

import org.hibernate.Session;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import br.com.jgmweb.bean.Chamado;
import br.com.jgmweb.dao.ConnFactory;

@Controller
public class Test {
	
	ConnFactory cFactory;
	Test(){
		this.cFactory = new ConnFactory();
	}	
	@RequestMapping("/test")
	public String execute(){
		System.out.println("Springs");
		Chamado c = new Chamado();
		Session session = cFactory.getSession();
		session.beginTransaction();
		session.save(c);
		session.getTransaction().commit();
		
		session.close();
		return "pag1";
	}

}
